package org.suyafei.service;

import org.suyafei.controller.request.ShortLinkAddRequest;
import org.suyafei.controller.request.ShortLinkDelRequest;
import org.suyafei.controller.request.ShortLinkPageRequest;
import org.suyafei.controller.request.ShortLinkUpdateRequest;
import org.suyafei.model.EventMessage;
import org.suyafei.utils.JsonData;
import org.suyafei.vo.ShortLinkVO;

import java.util.Map;

/**
 * @author 宿某人
 * @Date: 2021/12/17/3:34 下午
 * @Description:
 */
public interface ShortLinkService {
    /**
     * 查找短链
     * @param shortLinkCode
     * @return
     */
    ShortLinkVO parseShortLinkCode(String shortLinkCode);

    /**
     * 创建短链
     * @param request
     * @return
     */
    JsonData createShortLink(ShortLinkAddRequest request);

    /**
     * 处理新增短链消息
     * @param eventMessage
     * @return
     */
    boolean handleAddShortLink(EventMessage eventMessage);

    /**
     * 分页查短链码
     * @param shortLinkPageRequest
     * @return
     */
    Map<String ,Object> pageShortLinKByGroupId(ShortLinkPageRequest shortLinkPageRequest);

    /**
     * 删除短链
     * @param shortLinkPageRequest
     * @return
     */
    JsonData del(ShortLinkDelRequest shortLinkPageRequest);

    /**
     * 短链更新
     * @param shortLinkUpdateRequest
     * @return
     */
    JsonData update(ShortLinkUpdateRequest shortLinkUpdateRequest);

    /**
     * 删除短链
     * @param eventMessage
     * @return
     */
    boolean handleDelShortLink(EventMessage eventMessage);

    /**
     * 更新短链
     * @param eventMessage
     * @return
     */
    boolean handleUpdateLink(EventMessage eventMessage);
}
